package com.sc.education.utils;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.vod.model.v20170321.DeleteVideoRequest;

/**
 * @Auther: 段力博
 * @Date: 2020/9/27 21:38
 * @Description:
 */
public class DeleteVideoByIdUtil {

    public static boolean DeleteByVideoId(String videoId){
        try {
            //初始化对象
            DefaultAcsClient client = InitObject.initVodClient("LTAI4G1wEFciZb99oaB18kSa", "ju9sfURuo6gsQcySWCPEZxlSZx8nXI");
            //创建删除视频request对象
            DeleteVideoRequest request = new DeleteVideoRequest();
            //向request设置视频id
            request.setVideoIds(videoId);
            //调用初始化对象的方法实现删除
            client.getAcsResponse(request);
            return true;
        } catch (ClientException e) {
            e.printStackTrace();
            return false;
        }
    }
}
